//
//  EarningItemView.m
//  lianganyuchu
//
//  Created by iMac on 17/3/28.
//  Copyright © 2017年 杭州桑缇电子商务有限公司. All rights reserved.
//

#import "EarningItemView.h"

@interface EarningItemView()
{
    UILabel *m_labTitle;
    UILabel *m_labMoney;
}
@end
@implementation EarningItemView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self addSubviewsWith:frame];
    }
    return self;
}
-(void)addSubviewsWith:(CGRect)frame
{
    CGFloat width=frame.size.width;
    
    m_labTitle=[[UILabel alloc]initWithFrame:CGRectMake(kDistance, 0, 120, 40)];
    [m_labTitle setFont:[UIFont LightFontOfSize:15]];
    [m_labTitle setTextColor:TEXT_DEEP];
    [self addSubview:m_labTitle];
    
    UIImageView *arrowView=[[UIImageView alloc]initWithFrame:CGRectMake(width-9-kDistance, 12, 9, 16)];
    [arrowView setImage:[UIImage imageNamed:@"arror_rightgray"]];
    [self addSubview:arrowView];
    
    m_labMoney=[[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMinX(arrowView.frame)-kSmallDistance-100, 0, 100, 40)];
    [m_labMoney setFont:[UIFont LightFontOfSize:14]];
    [m_labMoney setTextColor:TEXT_MIDDLE];
    [m_labMoney setTextAlignment:NSTextAlignmentRight];
    [self addSubview:m_labMoney];
}

-(void)setDataWith:(StatisticsItemTable *)item
{
    [m_labTitle setText:item.name];
    [m_labMoney setText:item.total];
}


@end
